import React, { Component } from 'react'
import {Route,Switch,Redirect} from 'react-router-dom'
import Login from './component/Login'
import Wenji from './component/Wenji'

export default class App extends Component {
    render() {
        return (
            <div>
                <Switch>
                    <Route path='/login' component={Login}></Route>
                    <Route path='/wenji' render={()=>localStorage.getItem('token')?<Wenji></Wenji>:<Redirect to='/login'></Redirect>}></Route>
                    <Redirect from='/' to='/login'></Redirect>
                </Switch>
            </div>
        )
    }
}
